#!/usr/bin/env bash
set -e
cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1

kubectl delete -f ../manifests/nvidia-device-plugin.yml
sealos exec "cp /opt/nvidia-runtime/configs/config.toml.orig /etc/containerd/config.toml"
sealos exec "systemctl restart containerd.service"
sealos exec "rpm -e --nodeps libnvidia-container-devel libnvidia-container-tools libnvidia-container1 nvidia-container-runtime nvidia-container-toolkit nvidia-container-toolkit-base"
sealos exec "rm -rf /opt/nvidia-runtime"
